[##include file="common/header.tpl.php"##]
[##include file="common/nav.tpl.php"##]<style>.gridView td{padding:10px 0}</style>
<div id="main">
	<p>
    <form id="mapadd_form" method="post" style="margin-top:20px;" >
    地图名称：<input type="text" name="maps" id="maps" value="[##$list.name##]">
    <input type="button" value="提交" id="mapadd_submit" style="padding:5px 20px; font-weight:bold;" />
    <br />
    激活地图：<input type="checkbox" name="activate" id="activate" value="1" [##if $list.state == 1##]checked="checked"[##/if##]/>&nbsp;&nbsp;&nbsp;[##if empty($paving)##]<a href="[##$adminurl##]/?m=kingdomslady&a=mapalter&id=[##$list['id']##]&paving=2">铺通道模式</a>[##else##]<a href="[##$adminurl##]/?m=kingdomslady&a=mapalter&id=[##$list['id']##]">详细编辑模式</a>[##/if##]<br  />
    地图大小：<input type="text" name="map_size" id="map_size" value="[##$list.map_size##]" readonly><br  />
    解救对象：<input type="text" name="belle" id="belle" value="[##if empty($belle.name)##]暂无[##else##][##$belle.name##][##/if##]" readonly>
    <table class="gridView">
      [##foreach from=$arr_y item=y##]
      <tr>
        [##foreach from=$arr_x item=x##]
        <td title="[##$x##],[##$y##]" bgcolor="[##if $list['map'][$x][$y] == 1 || $list['map'][$x][$y]['map'] == 1##]#666[##elseif  $list['map'][$x][$y] == 2 || $list['map'][$x][$y]['map'] == 2##]#06F[##elseif  $list['map'][$x][$y] == 3 || $list['map'][$x][$y]['map'] == 3##]#0C0[##elseif  $list['map'][$x][$y] == 9 || $list['map'][$x][$y]['map'] == 9##]#FFF[##elseif  $list['map'][$x][$y] == 4 || $list['map'][$x][$y]['map'] == 4##]#F00[##elseif  $list['map'][$x][$y] == 5 || $list['map'][$x][$y]['map'] == 5##]#C96[##elseif  $list['map'][$x][$y] == 8 || $list['map'][$x][$y]['map'] == 8##]#FF0[##/if##]" [##if $y == 0 || $x == 0 || $y == $coord_y || $x == $coord_x##] onclick="alert('这是一面坚硬的围墙，不可编辑')"[##else##]
        [##if empty($paving)##]onclick="window.location.href='?m=kingdomslady&a=mapadd&x=[##$x##]&y=[##$y##]&id=[##$list.id##]';"
        [##else##]
        	onclick="window.location.href='?m=kingdomslady&a=paving&x=[##$x##]&y=[##$y##]&id=[##$list.id##]';"
        [##/if##]
[##/if##]></td>
        [##/foreach##]
      </tr>
   [##/foreach##]
  </table>
  [##if !empty($list.id)##]<input type="hidden" name="map_id" value="[##$list.id##]" />[##/if##]
     </form>
     围墙<span style="background-color:#666;">&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;人物<span style="background-color:#FF0">&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;通道<span style="background-color:#FFF">&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;河流<span style="background-color:#06F;">&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;绿洲<span style="background-color:#0C0;">&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;美女<span style="background-color:#F00;">&nbsp;&nbsp;&nbsp;&nbsp;</span>&nbsp;&nbsp;武将<span style="background-color:#C96;">&nbsp;&nbsp;&nbsp;&nbsp;</span>
  </p>
</div>
<script type="text/javascript">
// 绑定表单提交事件
$('#mapadd_submit').click(function() {
	var submit_url = '[##$adminurl##]/?m=kingdomslady&a=mapaltername';
	$.post(submit_url , $('#mapadd_form').serialize() , function(d) {
		if(d.code) return alert(d.msg);

		alert(d.msg);
		window.location.href = '?m=kingdomslady';
	} , 'json');

});
</script>
[##include file="common/footer.tpl.php"##]